
import { createRouter, createWebHistory } from 'vue-router'
import Dashboard from '../views/Dashboard.vue'
import Procurement from '../views/Procurement.vue'
import Warehouse from '../views/Warehouse.vue'
import ColdChain from '../views/ColdChain.vue'
import Store from '../views/Store.vue'
import Inventory from '../views/Inventory.vue'

const routes = [
  {
    path: '/',
    redirect: '/dashboard'
  },
  {
    path: '/dashboard',
    name: 'Dashboard',
    component: Dashboard,
    meta: { title: '风险预警大屏' }
  },
  {
    path: '/procurement',
    name: 'Procurement',
    component: Procurement,
    meta: { title: '采购管理' }
  },
  {
    path: '/warehouse',
    name: 'Warehouse',
    component: Warehouse,
    meta: { title: '仓储管理' }
  },
  {
    path: '/cold-chain',
    name: 'ColdChain',
    component: ColdChain,
    meta: { title: '冷链运输' }
  },
  {
    path: '/store',
    name: 'Store',
    component: Store,
    meta: { title: '门店管理' }
  },
  {
    path: '/inventory',
    name: 'Inventory',
    component: Inventory,
    meta: { title: '库存盘点' }
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
